package d1_com.itheima.thread;

public class Test5 {
    public static void main(String[] args) {
        Desk desk = new Desk();
        //厨师
        new Thread(()-> {
            while (true) {
                desk.put();
            }

        },"厨师1").start();

        new Thread(()-> {
            while (true) {
                desk.put();
            }

        },"厨师2").start();

        new Thread(()-> {
            while (true) {
                desk.put();
            }

        },"厨师3").start();
        //吃货
        new Thread(()-> {
            while (true) {
                desk.get();
            }

        },"吃货1").start();

        new Thread(()-> {
            while (true) {
                desk.get();
            }

        },"吃货2").start();

    }
}
